//
//  ByApiAddress.h
//  oc_knowledge
//
//  Created by mc on 17/1/12.
//  Copyright © 2017年 com.itboye. All rights reserved.
//

#import "ByNetBaseApi.h"
#import "ByModelAddress.h"


#define address_log_debug 1

#if address_log_debug == 1
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define ALog(...)
#endif

@interface ByApiAddress : ByNetBaseApi
#pragma mark - 查询接口，返回data为数组
/** 地址查询 */
/** result.data 为数组 数组中包含 多个ByAddressModel */
+ (void)addressQuery:(ByModelAddress *)model
             success:(void(^)(ByNetBaseResult *result))success
             failure:(void(^)(ByNetBaseResult *result))failure;


#pragma mark - 获取接口
/** 单个地址获取 */
/** result.data 为model */
+ (void)addressGetInfo:(ByModelAddress *)model
               success:(void(^)(ByNetBaseResult *result))success
               failure:(void(^)(ByNetBaseResult *result))failure;
/** 获取默认地址 */
/** result.data 为字符串 默认的地址id */
+ (void)defaultAddressGet:(ByModelAddress *)model
                  success:(void(^)(ByNetBaseResult *result))success
                  failure:(void(^)(ByNetBaseResult *result))failure;


#pragma mark - 上传接口，返回data为字符串
/** 地址添加 */
+ (void)addressAdd:(ByModelAddress *)model
           success:(void(^)(ByNetBaseResult *result))success
           failure:(void(^)(ByNetBaseResult *result))failure;
/** 地址更新 */
+ (void)addressUpdate:(ByModelAddress *)model
              success:(void(^)(ByNetBaseResult *result))success
              failure:(void(^)(ByNetBaseResult *result))failure;
/** 地址删除 */
+ (void)addressDelete:(ByModelAddress *)model
              success:(void(^)(ByNetBaseResult *result))success
              failure:(void(^)(ByNetBaseResult *result))failure;
/** 设置默认地址 */
+ (void)defaultAddressSet:(ByModelAddress *)model
                  success:(void(^)(ByNetBaseResult *result))success
                  failure:(void(^)(ByNetBaseResult *result))failure;



#pragma mark -暂时测试使用
/** 登陆 */
+ (void)loginTestSuccess:(void(^)(ByNetBaseResult *result))success
          failure:(void(^)(ByNetBaseResult *result))failure;

@end
